/**
 * Copyright：2020，TLF工作室。
 */
package com.cqeec.netdisc.config;

import java.util.Properties;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;

/**
 * @author 唐礼飞
 * 
 * @date 2020-10-19 12:05:11
 *
 */
@Configuration
public class ThirdPartyLbrary {

	@Bean
	public DefaultKaptcha captchaProducer() {
		DefaultKaptcha kaptcha = new DefaultKaptcha();
		Properties properties = new Properties();
		properties.put("kaptcha.border", "yes");
		properties.put("kaptcha.border.color", "105,179,90");
		properties.put("kaptcha.textproducer.font.color", "blue");
		properties.put("kaptcha.image.width", 125);
		properties.put("kaptcha.image.height", 35);
		properties.put("kaptcha.textproducer.font.size", 32);
		properties.put("kaptcha.textproducer.char.string", "0123456789");
		properties.put("kaptcha.session.key", "code");
		properties.put("kaptcha.textproducer.char.length", 4);
		properties.put("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑");
		Config config = new Config(properties);
		kaptcha.setConfig(config);
		return kaptcha;
	}

}
